/**
 * @author wcj
 * @Date 2021/6/1 13:03
 * @Version 1.0
 */
public class JvmStackSOF {

    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }

    /**
     * 虚拟机栈&本地方法栈因为使用的栈深度超过虚拟机允许的栈深度导致StackOverFlowError
     * -Xss128K
     *
     * @param args
     */
    public static void main(String[] args) {
        JvmStackSOF jvmStackSOF = new JvmStackSOF();
        try {
            jvmStackSOF.stackLeak();
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}
